import numpy as np
import pandas as pd
from pyspark.sql import SparkSession

if __name__ == '__main__':
    spark = SparkSession.builder. \
        appName("test"). \
        master("local[*]"). \
        getOrCreate()

    dates = pd.date_range("20130101", periods=6)
    pdf = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))
    sdf = spark.createDataFrame(pdf)
    print(type(sdf), sdf)
    kdf = sdf.to_koalas()
    print(type(kdf), kdf)
